package com.zw.hrm.feignclients;

import com.zw.hrm.fallback.RedisFeignClientFallbackFactory;
import com.zw.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "redis-server", fallbackFactory = RedisFeignClientFallbackFactory.class)
public interface RedisFeignClient {
    @PostMapping("/redis/set")
    AjaxResult set(@RequestParam("key")String key, @RequestParam("value")String value);

    @GetMapping("/redis/get/{key}")
    AjaxResult get(@PathVariable("key")String key);

    @PostMapping("/redis/setex")
    AjaxResult setex(@RequestParam("key")String key,@RequestParam("seconds")Integer seconds,@RequestParam("value")String value);
}
